import openpyxl as xl
import sys

if __name__=="__main__":
    print("test")
    wb = xl.load_workbook("%s/test.xlsx" % sys.path[0])
    sheet = wb.active
    row = sheet.max_row
    for i in range(2, row):
        valueEStr = sheet.cell(row = i, column = sheet["E"][0].column).value
        if valueEStr is None:
            continue
        try: 
            valueE = int(valueEStr)
        except ValueError as ex:
            continue
        print(valueE)
        cellF = sheet.cell(row = i, column = sheet["F"][0].column)
        if valueE <= 40:
            cellF.value = "1"
        elif valueE > 40 and valueE < 60:
            cellF.value = "2"
        else:
            cellF.value = "3" 
    wb.save("%s/test2.xlsx" % sys.path[0])

